#include "ALPAKAZE.h"

CALPAKAZE::CALPAKAZE()
{
}

CALPAKAZE::CALPAKAZE(CALStepItem* pStepItem)
{
	m_pStepItem = pStepItem;
}

CALPAKAZE::~CALPAKAZE()
{
}


void CALPAKAZE::test()
{

}
void CALPAKAZE::convert()
{
	if (m_pStepItem == NULL) return;

	try
	{
		CALSIPAKAZE* pStepItem = (CALSIPAKAZE*)m_pStepItem;

		//float nThreshold = pStepItem->GetItemThreshold();

		if (pStepItem != NULL)
		{
			AKAZE::DescriptorType descriptor_type = (AKAZE::DescriptorType)pStepItem->GetItemDescriptorType();
			int descriptor_size = pStepItem->GetItemDescriptorSize();
			int descriptor_channels = pStepItem->GetItemDescriptorChannels();
			float threshold = pStepItem->GetItemThreshold();
			int nOctaves = pStepItem->GetItemOctaves();
			int nOctaveLayers = pStepItem->GetItemOctaveLayers();
			KAZE::DiffusivityType diffusivity = (KAZE::DiffusivityType)pStepItem->GetItemDiffusivity();		
			
			std::vector<KeyPoint> keyPoints;
			Ptr<AKAZE> fast = AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, diffusivity);
			fast->detect(m_srcMat, keyPoints);

			drawKeypoints(m_srcMat, keyPoints, m_dstMat, Scalar::all(255), DrawMatchesFlags::DEFAULT);

			SetDstType(AL_DST_Mat_One);
		}
	}
	catch (...)
	{

	}
}

void CALPAKAZE::convert(const Mat &src, Mat &dst)
{

}